package core.models;
import java.io.Serializable;
/**
 * A person class for use in Oregon Trail.
 *
 * Holds a person's name, profession, health status, and age.
 *
 * @author m41a
 */
public class Person implements Serializable
{
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name;
    private int status;
    private boolean alive;
    public Person(String name)
    {
        this.name = name;
        this.status=100;
        this.alive = true;
    }
    
    public void setName(String name){
    	this.name = name;
    }
    
    /**
     * returns name
     */
    public String getName()
    {
        return name;
    }
    
    /**
     * returns status
     */
    public int getStatus()
    {
        return status;
    }
    
    /** used to set status
     * 
     */
    public void setStatus(int status)
    {
        this.status = status;
        if(this.status <= 0)
        {
        	alive = false;
        }
    }
    
    public void addToStatus(int add)
    {
    	this.status += add;
    	   if(this.status <= 0)
           {
           	alive = false;
           }
    }
    /**
     * returns person in string form with name and status
     */
    public String toString()
    {
        return name;
    }
    
    /**
     * returns alive
     */
    public boolean getAlive()
    {
    	return alive;
    }
    
    public void setAlive(boolean alive)
    {
    	this.alive = alive;
    }
}
